UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xs/gzf9Ho6fc1jSmmjG6KTrjcqM9Xpwaz3PYtoppbVw='
WHERE
key_id = '57ca6ebe764afb5fcfa3337bcd45911f61f4c764f29472c19a50b69dd27159a7'
AND (
token = 'xs/gzf9Ho6fc1jSmmjG6KTrjcqM9Xpwaz3PYtoppbVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)