UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H3zIF/HGGmJSFLhlZdlC8YdctcWS7MypIY5JEWgodGw='
WHERE
key_id = 'ee804267eafb356cf3b560de3407e6349c0eac806c508e8716ed69cd99b7d495'
AND (
token = 'H3zIF/HGGmJSFLhlZdlC8YdctcWS7MypIY5JEWgodGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)