UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sOjBqfaL+LpQPUBebfrA76FYMyyn/KVcG3XyPZSIyGA='
WHERE
key_id = 'b37cb5df4ed15dd4e70398730e3834a63cb886f6634b9c05a4e119f640de0722'
AND (
token = 'sOjBqfaL+LpQPUBebfrA76FYMyyn/KVcG3XyPZSIyGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)