UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0yFM2TrCf6LFf5iie6SQhglkgtjRomNohVG+pVG3VBU=' 
WHERE 
  key_id = '1b7539d42af84857428b6273d165d10cf3d4425a8da48bef79e0350d6178031a' 
  AND (
    token = '0yFM2TrCf6LFf5iie6SQhglkgtjRomNohVG+pVG3VBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046