UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MSVLUL+dsmK/bmzd21sw5pmo/bDanFlDXK10zA1tclU=' 
WHERE 
  key_id = '6b7a5a915e5f16afdaef48f528676ba15d3cf8b68dd9c2685ae78ff1a944c299' 
  AND (
    token = 'MSVLUL+dsmK/bmzd21sw5pmo/bDanFlDXK10zA1tclU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045