UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eVEQw90ooLR3PSFqhuoMqwN/HiMpZHqL9NkaLhgFys8='
WHERE
key_id = 'd79876ec8f638777d537e33007beae128d428dc22a6dd315e2b02f9dba6a9444'
AND (
token = 'eVEQw90ooLR3PSFqhuoMqwN/HiMpZHqL9NkaLhgFys8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)