UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kWag7A5vex7XQ63QH6AONOBPL6XFWvEBuZlbOza4Y38='
WHERE
key_id = '37cb233eff668aedfbbb87b4470f7cade6d7939a81ebec31fb623cc05c04cbbb'
AND (
token = 'kWag7A5vex7XQ63QH6AONOBPL6XFWvEBuZlbOza4Y38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)