UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6mPz9KaEGN4YJfDasAsjT9uG6EVdFdhD/4x71kWZTo='
WHERE
key_id = '233754abd5afd44681dbb99e2d7e395e5bdd760d343e49b3386eaa4e5ac063eb'
AND (
token = 'Z6mPz9KaEGN4YJfDasAsjT9uG6EVdFdhD/4x71kWZTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)