UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnUBlGBp7EaMZzRH8muZe8LBgKTM7nBlWlaujKi0j0o=' 
WHERE 
  key_id = '6f5cc75c982fa8b9d53055956e299e182769e9bf81d4bb4a59fde4765ed6526c' 
  AND (
    token = 'QnUBlGBp7EaMZzRH8muZe8LBgKTM7nBlWlaujKi0j0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026