UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0inGciilUYr+Rqte+vkoqhDYwwfaXdt6Gtl/BUFVob4='
WHERE
key_id = '11e21994a2152d1d243cf8439953a6b281415786e3f7d8a7a584e661d719739d'
AND (
token = '0inGciilUYr+Rqte+vkoqhDYwwfaXdt6Gtl/BUFVob4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)