UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gFjSmXToLevJB1uTryLfbJCZvfaqGcJZ4xIC/EpEuJQ=' 
WHERE 
  key_id = '1fa33b28fe53ae465c8dbef540f545a0138047007bf31029d9e7a87525fb8e90' 
  AND (
    token = 'gFjSmXToLevJB1uTryLfbJCZvfaqGcJZ4xIC/EpEuJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036