UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zh0y+jCH6OFIg3mQd7njdG4wCmdPeEgxBIfXtd/9hug='
WHERE
key_id = 'f7a28107fe88ae06565ce5f46aeff3bbbdc80c5585e33da30a4549b7daed8e7b'
AND (
token = 'Zh0y+jCH6OFIg3mQd7njdG4wCmdPeEgxBIfXtd/9hug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)