UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i041zry1cT4zYKSOX/X1SZyLXAxKrRlj0hAYP9Ug7no='
WHERE
key_id = '5224ac0c874cd1d054ededec267eede56ef84976f97a9f58b7f1ad616a25cc7f'
AND (
token = 'i041zry1cT4zYKSOX/X1SZyLXAxKrRlj0hAYP9Ug7no='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)