UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HI91V9lJFKtH8l3lD59485fC27jBBSZQFcRcg7asYYM='
WHERE
key_id = '0cc22c0a2d72b9b77b0c25715a73abf377dc75d77923c0ef5d08627420364d47'
AND (
token = 'HI91V9lJFKtH8l3lD59485fC27jBBSZQFcRcg7asYYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)