UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YABuTrAPDg1EbHYFlWn0bBZvYc8JGnaxhSYuZAvGITw='
WHERE
key_id = 'a6a0cbb294ec00ec515d2297c69bda3aa9ad6f2876124517ba686e6ecf6036c4'
AND (
token = 'YABuTrAPDg1EbHYFlWn0bBZvYc8JGnaxhSYuZAvGITw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)