UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bHwtGR5rBa97Ezne4MGbPUd2mq63Ir44rIoCbPI/jl4=' 
WHERE 
  key_id = 'dbe3073eb038754a485bf868b3ab10ff1b07563b708257998361b5e85d13f22d' 
  AND (
    token = 'bHwtGR5rBa97Ezne4MGbPUd2mq63Ir44rIoCbPI/jl4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00251