UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'irtWYIwpb0yPRzEv5NGFiYjMmM3t/nFJY0ZaX+q5EMU='
WHERE
key_id = 'f27fed257671e1bd750d75d99e6b59b2ef62b77a6b3dcb8346c3e4b302483c8c'
AND (
token = 'irtWYIwpb0yPRzEv5NGFiYjMmM3t/nFJY0ZaX+q5EMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)