UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ikf38yPcaj6mnYdBPdBaKMjQxgbQdKTp6PLhtFnVwow=' 
WHERE 
  key_id = '00b170f90569802a9ddb7c7065a6388d2a322821cc4abfb3ea6c4488ce34d4d9' 
  AND (
    token = 'Ikf38yPcaj6mnYdBPdBaKMjQxgbQdKTp6PLhtFnVwow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019