UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's99XpEGLo/SObqpl2ey1S4vQZDzgShAh/xpxLjHL8WI=' 
WHERE 
  key_id = '3669644cc5278266d0c219446344b8ba79c7ca843126f5c8ff1979756be45530' 
  AND (
    token = 's99XpEGLo/SObqpl2ey1S4vQZDzgShAh/xpxLjHL8WI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051