UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M9t89+UVFIDdAwJNtnkK3S4KxPLiZWLapD51qAz/S1k='
WHERE
key_id = '35e9f02447a8833ca50ab994ee867892ede0a5758b0677b696ca62a1ad971bd0'
AND (
token = 'M9t89+UVFIDdAwJNtnkK3S4KxPLiZWLapD51qAz/S1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)