UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1LjN1On5xnUX5+0ZdgsaJo21dKHm9YIw2pmcNndDebY=' 
WHERE 
  key_id = '8a4fdbf6c394cf94a0bcf5c554828dc8faea0c94d9510b979ac885af2681164a' 
  AND (
    token = '1LjN1On5xnUX5+0ZdgsaJo21dKHm9YIw2pmcNndDebY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031