UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b7HokUI6v7+Y2CGhILBR36cOtpOzIHhN80zoQuLalb0=' 
WHERE 
  key_id = 'da7972d31f1cfb5e953908c557a1e0f573053e708f0f1b80cf7d10bb961e8de1' 
  AND (
    token = 'b7HokUI6v7+Y2CGhILBR36cOtpOzIHhN80zoQuLalb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034