UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJSkynk5/eAwDe4DjUrYdirQk3NU8Ks/Tiytoavc7jg=' 
WHERE 
  key_id = 'b1d9457c89d10ff2ee62e1af9a1d6fe8f9fb3f4b3dbb157f0be4a5197b420298' 
  AND (
    token = 'FJSkynk5/eAwDe4DjUrYdirQk3NU8Ks/Tiytoavc7jg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023