UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DyEIOW09YiBotxkwNQRQS1hcEh9nz4yBHBQBNZrecV4=' 
WHERE 
  key_id = '470497bba05bfa8a93f9da5d1f6cd037baf244228b5bbe02ec2dd05e26850ce9' 
  AND (
    token = 'DyEIOW09YiBotxkwNQRQS1hcEh9nz4yBHBQBNZrecV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026