UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'coKBDxXq2ZguD9DhG6YVIaaufT7vdrG9X+AcgfFwzD4=' 
WHERE 
  key_id = '755e6a3e11d1287571c76667c5550f19828a19403d80a023d7381efe6bad0847' 
  AND (
    token = 'coKBDxXq2ZguD9DhG6YVIaaufT7vdrG9X+AcgfFwzD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029