UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Xn4/OSOg2DQx6Q4ufo4gxQo7jz4J/Hy+pEmSwSFc2Y=' 
WHERE 
  key_id = '93c821679a4fd1a1362f377b96cb8e3dc35c3711dc199a62149c437145113270' 
  AND (
    token = '0Xn4/OSOg2DQx6Q4ufo4gxQo7jz4J/Hy+pEmSwSFc2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047