UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SuK0hTmE5JMW2r5UKzFXrUi96nVXqKm8iOs8klC/VRI='
WHERE
key_id = 'faffaf72fd0c9d020df8fce3b96995acf9d089fc5f6759ab8afe022a239c9b31'
AND (
token = 'SuK0hTmE5JMW2r5UKzFXrUi96nVXqKm8iOs8klC/VRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)