UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1aFX5qBi8iZKzHi8kVQNJHo0cxG6hRsVIjKQGpUtU2k='
WHERE
key_id = 'e694e1cfa6e408a72c5ba34bf66ce3d5c0949c7a2401541b848e46e2a1053919'
AND (
token = '1aFX5qBi8iZKzHi8kVQNJHo0cxG6hRsVIjKQGpUtU2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)