UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LyG4MevUg4aP5+GzcV7VjQqNTvP1F/99VMH93W7qSiQ='
WHERE
key_id = 'dfc60f12b079abc6137354d7c2b6d92c52a871298f5fadc66ced5372de989390'
AND (
token = 'LyG4MevUg4aP5+GzcV7VjQqNTvP1F/99VMH93W7qSiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)