UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rmBO2QgLaVjrxKyzEuSI4c7gd1V08XAJlJC88Tz0wDM=' 
WHERE 
  key_id = '88318c6f25aca8bb7614db10272aa549b7b616e72d526350a8345d9741ffda3a' 
  AND (
    token = 'rmBO2QgLaVjrxKyzEuSI4c7gd1V08XAJlJC88Tz0wDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024