UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxFSX/ccmddFO+y9GV9pXsN4ooBJyR0JPJ+khM94MJA='
WHERE
key_id = 'eed2523e2e66eff50c195d2013555f3af63d17758b85cdb1245fbf23fbe8adc1'
AND (
token = 'VxFSX/ccmddFO+y9GV9pXsN4ooBJyR0JPJ+khM94MJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)