UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C+c2gZLfNulzNyu4zWLyNhHE7yhd3pq9y6iVPsAasv4='
WHERE
key_id = '34908a66aae6c93e3a2a25967cc6aa151d1d9139210c3c167bee748604230f8d'
AND (
token = 'C+c2gZLfNulzNyu4zWLyNhHE7yhd3pq9y6iVPsAasv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)