UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uBcZ6Vbkp2rMBWS5nHEMC5uKg9PLuQivHZGkh3+/03E=' 
WHERE 
  key_id = 'de1872d1396f774f67aa07591b93180092b15955a03c8cfc3269e8e69c64f489' 
  AND (
    token = 'uBcZ6Vbkp2rMBWS5nHEMC5uKg9PLuQivHZGkh3+/03E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025