UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QsHzJVjazMeq0Y0ZuMq0vcu27JK+iwcyP0UBhuOOJBU='
WHERE
key_id = 'fc5d4d99a01c9df1154fd0a39f3760e1876190b7389ecc465499cfa4ec562c25'
AND (
token = 'QsHzJVjazMeq0Y0ZuMq0vcu27JK+iwcyP0UBhuOOJBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)