UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'InqlvQJtan0bzSPTF2TkwzWlYvkLXTwjYbt/LZOuE1k='
WHERE
key_id = 'ec6388aafc81a7d07ef6cddf6b05318c3f73f05f6d1848b8bc6b8ceeb320d71d'
AND (
token = 'InqlvQJtan0bzSPTF2TkwzWlYvkLXTwjYbt/LZOuE1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)