UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9nQkgEeTz23aJ+JudoYDwK139C7KoJeGOSQWVMRooJ0=' 
WHERE 
  key_id = 'e8192fb7231006589894420887dcc6cdd8e3591957ffc2833cb10734728df31e' 
  AND (
    token = '9nQkgEeTz23aJ+JudoYDwK139C7KoJeGOSQWVMRooJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020